package com.web.kdl.daoV2.auth;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.web.kdl.entity.auth.RolePermission;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author： shulibin
 * @Date： 2025/7/30 14:28
 * @Describe：
 */
@Mapper
public interface RolePermissionDao extends BaseMapper<RolePermission> {
    @Insert("<script>" +
            "INSERT INTO role_permission (role_id, permission_id) VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.roleId}, #{item.permissionId})" +
            "</foreach>" +
            "</script>")
    int insertBatch(@Param("list") List<RolePermission> list);
}
